/*
 * FinishTask.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

class FinishTask extends DefaultInstruction{

	int code;

	public FinishTask(NameSpace ns, int delaybefore,
			InstructionDescription desc, int code,
			DefaultInstruction next){
		super(ns, delaybefore, desc);
		add(next);
		this.code = code;
	}

	public void execute()
	throws InterpretTimeException, SimulationStoppedException
	{
		waitToRun();
		xConsole.trace(super.toString());
		xConsole.cout("finishing simulation");
		Time.stopSimulation();
	}

}



